#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int a[110];
int main()
{
	int n,num1,num2;
	while(scanf("%d",&n)!=EOF)
	{
		num1 = 0;
		num2 = 0;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i]%2) num1++;
			else num2++;
		}
		printf("%d\n",min(num1,num2));
	}
} 
